package com.l2jserver.gameserver.communitybbs.Manager;

import com.l2jserver.gameserver.cache.HtmCache;
import com.l2jserver.gameserver.communitybbs.Model.BaseBBSManager;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;

/**
 * @author fissban
 */
public class HomePageBBSManager extends BaseBBSManager
{
	@Override
	public void parseCmd(String command, L2PcInstance activeChar)
	{
		if (command.equals("_bbslink"))
		{
			String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "data/html/CommunityBoard/custom/homepage/homepage.htm");
			if (content == null)
			{
				content = "<html><body><br><br><center>404 :File not found: 'data/html/CommunityBoard/custom/top/homepage.htm' </center></body></html>";
			}
			separateAndSend(content, activeChar);
		}
	}
	
	@Override
	public void parseWrite(String ar1, String ar2, String ar3, String ar4, String ar5, L2PcInstance activeChar)
	{
		//
	}
	
	public static HomePageBBSManager getInstance()
	{
		return SingletonHolder._instance;
	}
	
	private static class SingletonHolder
	{
		protected static final HomePageBBSManager _instance = new HomePageBBSManager();
	}
}
